/*
 * Commande.h
 *
 *  Created on: 21 dec. 2012
 *      Author: guegan
 */


#ifndef _COMMANDE_H_INCLUDED_
#define _COMMANDE_H_INCLUDED_

#include <iostream>
#include <string>
#include <map>

using namespace std;   

class Invocateur;

class Commande {
private:
	static map<string, Commande*> commandes;
	
public:
	Commande(string nom);
	
	class NonReversibleException {};
	
	static Commande* nouvelleCommande(string nom);
	virtual Commande* constructeurVirtuel() = 0;
	
	virtual void execute() = 0;
	virtual void desexecute() = 0;
	virtual bool reversible() = 0;
	
	static void setInvocateur(Invocateur* com);
	
protected:
	static Invocateur* commandeur;
};

#endif
